import { defineStore } from 'pinia';
import { GlobalState } from '@/store/interface';

export const global = defineStore({
  id: 'global',
  state: (): GlobalState => ({
    index: 1,
  }),
  persist: true,
  getters: {
    getIndex: state => state.index,
  },
  actions: {
    setIndex(index: number | string) {
      this.index = index;
    },
  },
});

export default global;
